package com.hxxy.wyp.petsLover.common.rest.base.backend;

import cn.dev33.satoken.annotation.SaCheckLogin;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.dev33.satoken.annotation.SaCheckRole;
import com.hxxy.wyp.petsLover.RestBase;
import com.hxxy.wyp.petsLover.common.entities.vo.resp.DashboardVo;
import com.hxxy.wyp.petsLover.common.services.base.backend.DashboardService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName DashboardRest
 * @Description Dashboard接口
 * @Author wyp
 * @Date 2022/12/25 11:12
 * @Version 1.0
 */
@RestController
@ResponseBody
@RequestMapping("/dashboard")
public class DashboardRest extends RestBase {

    @Autowired
    private DashboardService dashboardService;


    @RequestMapping("/countAll")
    @SaCheckLogin
    @SaCheckRole(value = {"super_admin","user_admin","commodity_admin","other_admin"}, mode = cn.dev33.satoken.annotation.SaMode.OR)
    public Object countNumbers(){
        DashboardVo dashboardVo=dashboardService.countAll();
        return ajaxSuccess(dashboardVo,"200","成功");
    }
}
